Updated to handle anonymous users and content