fixed error is getting field value too soon