some refactors

ActionWindow can be shown without crash