fixed the duplicated import and changed qmgr to _qmgr