Fixed global scope js variable