dnd example :: fixes in js and refactoring