Improve ajax preview reliability