some reworks. added exception