Edit appointment function