fix some bug and add interface for entity which have a lifeCycle