added magicalrecord support