Fixed constructor to load resource from a String