fix small bug, more logging