refactoring
fixing bug