Wrapped set_data in a try/except block to prevent crashing on no connection. Hhhmmm...