running processes variable doesn't work

Then your if condition is wrong, can you post it?

Possibly have a look at the example and discussion here How can I reliably detect if a specific app (with a short name) is running for automation purposes?