fix order related bugs