Revise coding on handling presence event