cursor was not checking cursor.getCount() > 0 before working with it,
could cause crash