adding the capture method (environment) to data cash
added unit test for capturemethod