Changes to make this work for GAE