fix bugs and add grunt tasks