added trycatch