change check method, make it suitable for pagination