Fix crash

In some weird cases `ps` may crash. This fix prevents us from crashing as well.