added const qualifier to getWidget