fixed everything except preview button doesn't work