upgraded autostart script
upgraded background script