Added check if the user is logged in on messages block