don't know why double free error occurs, removing free