tweaked for validation