fixed bugs with upstart script