changed .click to on('click')