fix read log function