Making validate function non-static