Fixed presence events

convert present to list before send in event
move old_present init outside while loop