added length_check, prefix check might be useless now
added length_check, prefix check might be useless now