Added checks for the Current user to chat.php