Global variable fix