use resource loaded instead of file