finally got a smooth preview working