Added flush_handlers to force handlers to execute

A flush_handlers line has been included in order to cause the handlers
to immediately execute.