added check valid function test