fixed bug in pagination componenet