alternate solution to error handling

check this out.