added some validation logic to VariableModel