Add user validation function