changed cmd.sub to work with module