repair resource bug