moved boundary to correct place inside attachment loop