better logging
Fixing bug