validate uniqueness in server side