Adding success function code