fix bug in portalocker code