removing NaNs generated by update nets