fixing some entity problems