metrics finished and memory allocation error fixed