fix wrong allocation