Fixed 'Invalid memory access'