Is your button a checkable button? If not then 'checked' is going to always be false. Have you used a debugger to break in that function and see what value it's being supplied with?