Variable autostart is not used outside main()