changes to fix bug with patterns load to js