fixed bug in 404 handling