fix preview bugs