added check if Auth::user() existed before asking for its id property