Partial fix to paginate method