updated appointment add function