Use ps -p instead of wait (process is not child)