found the bug: missing int conversion