Fixing the invite function