check if file is not a directory