Updated the listening functions to work better.