updated scripts to work better on startup