Modified pagination class: fixed spacing in if condition