add asserts (thanks jk!)