fix bug, still slow