updated Connection.onData logic to do callback routing