[BUGFIX] Fixes memory leak