Made a method to check if a process is running