added order query function