fix the bug but stil very slow