adding slightly modified version of @mattupstate's version fix