Fixed init function called twice issue.
Fixed resource import issue.