Fixed crash bug on unbind (temporary fix)