adding selected and disabled state to pagination buttons