added qm and fixed