a more elegant solution added for 2.28 along with my initial one