Adding more logs and making sure defer is queued before sending the commands out