fixing preview button bug.