fixed userid detection