take mover query outside function