handle the numpy runtime warning: dvide by zero

numpy sometimes raise a runtime warning which is not catched by original try{} except