fix preview bug + misc