added restart if memory is more than 400mb