initialized empty messages array in controllers