added check if input.value is empty