fixes global variable and white space