fixed some bugs and fixed drag/drop