added client side checking of the primary ket existance and originating from same datasource