resolved duplicate allocation bug