Added sanity check to constructor