fixed some more memory errors!