Fixing appointment bug in convert database script