clean up ui scripts
fixed js errors on demos page