fixed switch+try/catch problem