fix NullPointer on phone when the server closes