Used better approach to determine the global body state.