Quick fix

Prior to this commit we hardcoded the indexes, this causes problems when
we change the indexes due to removing and adding devices