fixed issue with EOF