Added an algorithm to send a 404 error for physical files not found