scrollspy needs to be attached after all dom changes in order to work ok,I've changed the order