tweaked generation of preview