checks if process is already running and stops if it is