added createTabIndex function to improve UX for form input