error handling for front