added scenario-handling code
merge fixed