implemented check function