Fixed pagination not working before data loaded