Add delete object function.