(cherry picked from commit de56862bb97b092c5fc44359caf3b2abdbcfdf96) Closes #2186
Since it applies to all of frontend, I think it makes more sense to have it here instead of src (cherry picked from commit e12c679cd8961ec9d2ef744761303831b81e64fb)