Updated validate logic