fix use of wait in rootpy script