fixed modulo behaviour