fixed a bug in the office preview code