Ensured that only one process is running.
Updated script. Better working.