put syncing promise resolution in a closure for path var