bug fixed for different mode