Fix beforeSend context