functions to get and load model