Added try/catch blocks
Update