script to get metadata