fix bug write console