Added input checking for d