fix issue when creating objects