fix: breaking from loop properly