fix validation check