updated cloud code