Added more log handling
Logging improved