Fixed horrible memory leak