fix bugs: log function usage