fixed the bug, insanely slow