added try except block
merge conflict resolved