added assertion
the last pull request introduced a check which handles a potential bug in the library