found the bug and fixed it