Change create object funtion