added try catch blocks...