error on adding fields (bad function