Added functionality to check if user is online before sending an alert