figured out bugs to retrieve core data