Updated listen function to pass value and mapping arguments to callback function