The conditions to show and hide field do not work properly