fix bug in mmap