fix bug with previous button