fixed wrong allocation