Fixed ValidEntity bug