It added a sleep before the update_status_with_media, to avoid an error when try to connect to the twitter api.