bug with empty input fixed