move query function from player into query command