returning a 404 instead of internal server error