added support for fn functions in when loading resources