FIXED BUG: issue with key variable