Correcting undefined pid output