fixing next and prev buttons