Fixed enviroment issues so it will run with foreman