fixed controller indexing issue