fix some bugs and add square brackets filter