added correct error handling for 404