updated pmemory to have variable directory