Added preview functionality