fixed model scoping issue