working on the exception catching