fixed error with deleteglobalref