tried to implement getPid in new fashion