fixed a small bug in mmap