remove undefined variable error
fix a number of bugs in XLS view