change logic, bug fix