onConnected now working