Fixed error with multiple instances

Script now terminates if it is already running