fix the getAll function