added two exception cases; probably needs more... -sai