fixed bug in managed object context