WIP
fix missing length check in unify