added clear entity function