added code to catch expected exception
passes
added code to cover exceptions