corrections to script to work with scala backend