Bug fix, still have bugs in js