fix bug in reference field validation