Added minor validation for checking input fields