fix resource bug