fixed another invalid memory access