add some exception handling