fixed problem with refactor