Updated listener code to catch and continue in all circumstances