updated to use agent's @import function and moved constructor event handlers into the run function