Show/Hide conditions are not working correctly