fixed KeyError at orm base