making this helper work for input boxes as well