Move dialog closing into ajax callback