changed index to work