fixed bugs with ravendb query