Fix object delete funcitonality