Added more exception catching and log messages