refactor ajax auto reject