Added isvalidconfig function to models