remove a couple memory allocation problems