}
String newSide;
//if user want some side effects be deleted.
if(delSide != null){
newSide = delSide;
addSide = new SideEffect(Integer.parseInt(newSide));
addSide.setName(form.getName());
addSide.setOwner(user.getEmailAddress());
//addSide.setAllNum(allNum + 1);
//create a new user.
sideDAO.create(addSide);
synchronized(session){session.setAttribute("deletelistside",delListside);}
//if no scheduled medication be deleted.
}else{
int allSize = sideDAO.size();
//initialization situation.
if(allSize == 0){
newSide = Integer.toString(allSize);
addSide = new SideEffect(Integer.parseInt(newSide));
addSide.setName(form.getName());
addSide.setOwner(user.getEmailAddress());
sideDAO.create(addSide);
synchronized(session){session.setAttribute("deletelistside",delListside);}
}else{
allSize = sideDAO.getLastId();
newSide = Integer.toString(allSize);
addSide = new SideEffect(Integer.parseInt(newSide) + 1);
addSide.setName(form.getName());
addSide.setOwner(user.getEmailAddress());
sideDAO.create(addSide);
synchronized(session){session.setAttribute("deletelistside",delListside);}
}