added support for multiple text inputs