Using resolve to avoid FOUC