incorrect memory allocation, should be fixed now