Hide loader when changing to another segment
Refactor to use send to dispatch function dynamically