Plan and resources added
properly frees device memory