fixed input checking