Added try/except block