fixing try/catch error