fix bug with field position being out of order