Had to sanitize arrays using array_map