fixing js issue and adding functions for event links addition