fix removing resource