fix logic, work version