next time don't use global vars