added some drag action and fixed a few bugs