added more validate function