redirect to 404 page if id is not set, or if the id is not found in the database.