Exception catching implemented