Updates to get this working on the app engine