fix JSLint problems, dragging outside of box bug