fixing preview bug in editor