fix finite m bug