fix assign resource bug