Sort of fixed the bug