Added headprefix and -suffix length check