Slightly hack-y fix to out of index problem