reapplying lost commit (https://github.com/arekais/ravendb/commit/ac4e6eaa9a0587253e40bb87c1eaedfbc2fda5dd)