Illegal string offsets when adding new entries