ensure variables are of correct type