made files() check for type==file