refine invite friend functionality and recreate components in menu page programmatically