Added exec functionality to use callback function