move the seek/open into the function that uses it