Invalid log error query on 404 page