added try block to catch ValueErrors