trying validation function