added error state for input fields