add some exception processing