adding more exception catching