improve catching exception