fix widget delete function