changed user==null back to user != null.