updated delete object method