fixed bug that failed to check if process is already running