added logic that verifies user is logged in before chatting, voting or submitting a question