fixed sqls, imlemnt unread msgs