added debug logging
Merge pull request #415 from nelenkov/dev

added debug logging