check for directory or file as input