finished appointment function