Add function corrected