adding .nextTick() logic to every .mapSeries() and also fixing some syntactical javaScript errors