close some activities before calling others