Make the commands asynchronous to avoid connection timeouts. Will need to change this probably to make it more elegant.
Close connection if exception occured