fixed bug in log implementation