moved package require to beginning of script