allocation bug fixed