fixed a bug in queryToArray callback usage