Small bug correction when creating an entity