add toLinkedMap() method
fix bug for count() with join