Bug: fixed wrong global var