fixed metadata regex
clean up debug prints