[FIX] Factor should be compared with factor, not id