synced with karambir master