Added more exception handles