you should throw the exception only when trying to set it to true, not when setting it to false.