fix astropy API bug