added function to set model