added core data support