avoid global vars