add check
refactoring