fix label removal code