added support for weak references in input for garbage collection reasons#