fixed logging issue code