implemented error handling for admin page