added onError, shortAdd and tests.