fixed user query where session[:id] is NULL