make sure models is defined