add validity check before path is filled.