freeing allocated space. validation working.