fix silly replace all error
ensure onClose is called if an error occurs during action/download
0.3.4