corrected buffer size and added Version Flag