fixed bug with local/global var debug