cleaned up connect_callback