last fix was wrong, smlen was invalid instead