add pagination but with some problems