Adding logic to handle submissions faliure