adapt loop