Fixed Bug with Model Code