fix cloud/not-cloud logic