fixed FROM to reference correct variable