Added throw statement to catch error.