added security and read flag on message table