fixed issue with next and prev buttons