added a random port number with a c# script
added exit command to error path