Fixing preview bug