Credit @matrixik for #3441