fixed validates and thread safe problem