Whoops…change check for message->sent to 0 rather than using is_null