Fixed error on empty input