pass in object, not event to if block