fixed issues after refactor