hotfix for leave query