preview box starting to work, but a few bugs