make release method more robust