invitation js button code refactored