Fixed error in entities.functions