Fixing error running ps when environment is stopped