Move preview outside condition