Simplified the code
Giving visual feedback to the user after successful invitation