fixed a memory violation issue in potlib initialization