Changed add thread to send push message properly.

I.e. we're now getting the ids from the database.