Fixing issue #291 (WIP)

should also remove sync.cleanupFn