Add routine to check for input