better implementation of afterware, using server.on(after)