Updated to the same functionality as 7.x version.