fix offset by 1 , pages start from 0