fix lastAdded directive