get rid of ugly hack in onLoadFinished, add listener for junit tests