Added flags to clear activity stacks