Changing case block to filter on extension