Fixes a bug when fast switching between indexes could stall the app