bug fix for custom modelks
changed order
minor tweaks