add variable checks