Bug fix with setting visibility for gadgets