Resolved the double-free problem

#42