this seems to fix the bug