further work, now working fine.