fixed broken editor and javascript errors

I fixed the broken Javascript.