fix issue with globals vars