fix logic problem & defaults