adding classes to the next and previous links