changed offset to off_t