fixed permission overlay
restored code from 2 versions behind