better input checking.