have to preserve keys when sanitizing arrays