Bug fix in main, setting adjust after ptr is resetted