Better handling of preview script