added valid javascript checks
removed loop to use Dict.get() method
used old metadata file