Fix timing issue of surface creation