bug fixed  log function.