make preview box work