throw on invalid