fix release resources