proper input checking