refactored reject error handling