checkifvalid
tests
