thiz should never be a global variable. If is declared anywhere else it will have major side effects.