bugfix for memory access failure