Added an error checkto the processes cmd