Fix is_autostart function

fix a bug while try to look an empty array.