Fix the mess with active and inactive buttons