added sid to messages model
save messages to database