Fixed using deprecated global variable