added createFromResource