fix for _free_stmt method