add null check for mSurface at ReplaseSurface