Updated to work with latest tornado