added definition of missing $modname variable