fix order generation