update maxlength condition
drop old variables