fix wrong vector loop