fixed incorrect seekg() usage