Added an extra assert for the error message