Fix bug in presence service
Unit test of presence service