Have function check validity