fixed some compatibility issues