improve fileIsAllowed check order and messages