fix bug according to @armgong