added required check for inputs