added exception handling to each method