fixed wordlength bug