solve the data shifting issue