tweaked webhook logic