moved  variable to top of script