tomodal plugin added + fix some bugs in modal.js