fixed threading issues
added extra validation