reverted to the original 1.X implementation, but fixed it