fix memory allocation once again, got a proper maxsize now