still trying to fix the validation logic