Variable check function