fixed bug in remove resource