Added empty input validation