handle index with space cases