added has_many :messages and unread method