add compatibility code for 1.0.4