fixed issue where user closes modal before sync finishes