Added try/catch for errors