use ps -p instead of kill -0 to check if process exists