fixes #3915 - better handling of 404 exceptions