Fixing success function syntax