Fix the listener to not lose data