ap message loop added.