fix validation logic

Change-Id: If54d689382f87e62dafc075656022aee7751478a