Added logging
Fixed logging