debug the nullpointException in server encoder