fixed bug in logging