made testing script more robust again