fixed logic bug with cleaning of presences