Fix code to add at end