fixing orm case problems