add n and p for next and previous