fixed mmap bug