correctly handle user being null