fix issue where modelname wasnt being accessed correctly