use validator function in Service