It seems there is a bug when the last time step is selected. If you press a right arrow again, the latest file is used and non of time steps is highlighted.
This happens because dirs actually contains the latest file that isn't used in the timeline. Personally, this should be fixed in a separate issue.