added some validations and callbacks to invitations