Fix error in js
Fix error in scope
Correctly swap finish state