fix bug: free regex list in cleanup