added conditional click/touch listeners