added check in inputs are empty