Fix the bug the render texture is not restored properly when switching to background