controller邏輯修正 and fix test