LPS-51147

it works. also added one more check so that the group id isnt appended to links that havent been set to a page yet