some changes for compatability with spree 1-3-stable