[FIX] Write buffer to fd instead of string