Changed to support running in google app engine