fixed a bug where message length wasnt included in error message