implement check() method