added some changes for dynamic spinner functionality.