made file seeking more robust.