fixed reverse pattern bug