added captured function