added throwing an exception; updated docs