update to simplefy the input checking