bind outside loop