trying to find bug with core data document