calling brjs.close inline and removing the shutdown hook