fixed several bugs with grid display