fixing upgrade script if order is not set