Added documents action and loop