more places needed the $invert_time variable declared global to be able to be read...