fix a bug in helpers when calculate size of field