bug fix - memory