improved test of last attribute