added try-except which should be removed ASAP.