Update spa.js

bug fixed