mv back to private rather than global, as the close will free the wrong memory. no idea why it would segfault. mine sys is ok no segfault