oops, finally found the bug