refactored code for bad route when controller exists