Fixed makereply to account for deprecation in res.send and race condition.