Finally solved problem with events when entity is created