updated script to accept commandline parameter as collection name