add eof handler: sometimes #of RE doesn't match