Show and Hide conditions do not work properly