first attempt to fix memory issues...