Added better logging and error page