add acitivitymanager and fix some issue