fix bug in init field, auto detect invalid self-binding of resources