already found a bug from refactoring