Move disconnect listener to the correct position