Updated paginate to only show when necessary