Use eventStatic for before_query