fix mmap bug