imporved the scripts and upstart scrpts