fix a bug in autostart