bugfix
speedup allocation