adding func from old version