deck updated to check for null items and mod selectedIndex