Implemented a proper changeName function for objects