tests added
added try catch