Fix bugs in add and delete appointment