implemented check queries