fixed duplicate error message for empty input