Added logging and handling of failed submission