Added method to free unused surfaces