updated syntax and fixed a bug in model loading