add hidden field and logic