fix off by one error for error message