change alert to messages at index