refactored codes involving routes, fixed blank route hashes redirecting to home route