Fixed bug when getting next contact to alarm