Check headers have not already been sent in errorHandler