fork of dinero, made thread safe