adding removedByQuery(); fixing null values with type casting