Added restart function after loss.
fix
fix