add support for dynamic sources, fixes #2