Fixing try/catch syntax