fixed validation check