implementing stylus middleware