If your cookies didn't keep their shape when baking it's likely because the dough was too soft, either because you added too much butter, butter that was too soft, or not enough flour. Chilling the dough for 30 minutes before baking can prevent the cookies from spreading and turning out flat.