fixed getline so it works across platforms with no hacking