fixed bugs in gulpfile and some optimization