added exception processing