added assertions to constructor