added for location stay calculation