Memory  error fixed