fixed leak $ into global