refactoring and added error404 page