added 404 handling to handler