added accessibility including tests
fixed wrong type of exception