Fix memory error caused by last commit