added special input checking.