#131 update preview when switching tabs