updated invite context event listeners and fixed various errors