Same logic as #1489
Same logic as #1489