Added try/except statements