wraps source in DOMContentLoaded event