Better try handling code