updated query resolved with cursor.moveLast function