fix sid is undefined bug