properly handle EOF