fixed pesky memory bug