added a try catcg