Correctly use a callback for the listen operation