changed deleted cursor.next_object method to cursor.next